@RestController
public class NotificationController {
    // ...
    @MessageMapping("/comments")
    public void handleComments(
        @Payload CommentMessage commentMessage,
        Principal principal) {

        notificationService.sendComment(
                commentMessage
                .toNotification(principal.getName()),
                commentMessage.getTo()
            );
    }
}
